/*
 *  After this demo, we know that the swap functon only swap the 
 *  memory of elements between two parameters.
 *
 * */

#include <iostream>

#include <vector>

using namespace std;

int main(int argc, const char *argv[])
{
    vector<int> v1, v2;
    v1.resize(10);
    v2.resize(15);
    v1.push_back(10);
    v2.push_back(20);
    cout << "v1[0] value:" << v1[0] << ", v1[0] address:" << &v1[0] << endl; 
    cout << "v1 size:" << v1.size() << endl;
    cout << "v2[0] value:" << v2[0] << ", v2[0] address:" << &v2[0] << endl; 
    cout << "v2 size:" << v2.size() << endl;
    swap(v1, v2);
    cout << "v1[0] value:" << v1[0] << ", v1[0] address:" << &v1[0] << endl; 
    cout << "v1 size:" << v1.size() << endl;
    cout << "v2[0] value:" << v2[0] << ", v2[0] address:" << &v2[0] << endl; 
    cout << "v2 size:" << v2.size() << endl;
    return 0;
}
